% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/kerasnip_spec_methods.R
\name{set_engine.kerasnip_spec}
\alias{set_engine.kerasnip_spec}
\title{set_engine Method for kerasnip Spec Objects}
\usage{
\method{set_engine}{kerasnip_spec}(object, engine, ...)
}
\arguments{
\item{object}{A \code{kerasnip_spec} model specification.}

\item{engine}{A character string naming the engine (e.g., \code{"keras"}).}

\item{...}{Additional engine-specific arguments passed to
\code{parsnip::set_engine.model_spec()}.}
}
\value{
A \code{model_spec} object with the \code{kerasnip_spec} class and metadata
attributes re-attached.
}
\description{
S3 method for \code{set_engine()} dispatched on \code{kerasnip_spec} objects.
\code{parsnip::set_engine.model_spec()} internally calls \code{new_model_spec()},
which re-creates the spec from scratch with only \code{c(cls, "model_spec")} as
the class vector — stripping \code{kerasnip_spec} and any custom attributes. This
wrapper preserves the \code{kerasnip_layer_blocks} and \code{kerasnip_functional}
metadata attributes and re-attaches them (along with the \code{kerasnip_spec}
class) after \code{NextMethod()} has done its work.
}
\keyword{internal}
