Socket
Book a DemoInstallSign in
Socket

create-tensorify-plugin

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-tensorify-plugin

Create Tensorify plugins with the latest SDK - Linear layer template

2.0.7
latest
npmnpm
Version published
Weekly downloads
1.5K
-7.64%
Maintainers
1
Weekly downloads
 
Created
Source

{{projectName}}

{{description}}

A Tensorify plugin that implements a PyTorch Linear/Dense layer with customizable input/output features and bias settings.

Installation

npm install

Usage

import {{projectName}}LinearLayer from './dist/index.js';

// Create a linear layer instance
const linearLayer = new {{projectName}}LinearLayer();

// Generate code with custom settings
const code = linearLayer.getTranslationCode({
  inFeatures: 784,
  outFeatures: 128,
  bias: true
});

console.log(code);
// Output: my_plugin_linear_layer = nn.Linear(784, 128, bias=True)

Configuration

The linear layer accepts the following settings:

SettingTypeDefaultDescription
inFeaturesnumber784Number of input features
outFeaturesnumber128Number of output features
biasbooleantrueWhether to include bias term

Development

# Build TypeScript
pnpm run build

# Watch mode for development
pnpm run dev

# Run tests
npm test

Example Configurations

Basic Linear Layer

{
  inFeatures: 784,
  outFeatures: 128
}

Linear Layer without Bias

{
  inFeatures: 512,
  outFeatures: 256,
  bias: false
}

Small Dense Layer

{
  inFeatures: 64,
  outFeatures: 32,
  bias: true
}

Plugin Structure

  • src/index.ts - Main plugin implementation
  • manifest.json - Plugin metadata and configuration
  • test.js - Plugin tests
  • tsconfig.json - TypeScript configuration

Generated Code

This plugin generates PyTorch code for Linear layers:

import torch
import torch.nn as nn

# {{projectName}} Linear Layer: 784 -> 128 features
{{projectName}}_linear_layer = nn.Linear(784, 128, bias=True)

SDK Compatibility

This plugin is built with the Tensorify SDK v0.0.1 and extends the ModelLayerNode base class for optimal compatibility and functionality.

Contributing

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

License

MIT © {{year}} {{author}}

Created with

This plugin was created using create-tensorify-plugin.

Keywords

tensorify

FAQs

Package last updated on 26 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.