pytensor_ml.layers.Input#

pytensor_ml.layers.Input(name, shape, dtype=None)#

Create a named symbolic input tensor.

Parameters:
namestr

Name of the input variable.

shapetuple of int or None

Size of each dimension. Use None wherever the size varies between calls, such as a batch axis.

dtypestr, optional

Data type of the input. Default floatX.

Examples

Start every network with one: it names the placeholder a batch is fed to, with None wherever the size varies from call to call:

from pytensor_ml.layers import Input, Linear

X = Input("X", shape=(None, 64))
activations = Linear("fc", n_in=64, n_out=10)(X)