Skip to content

Commit ba36f9e

Browse files
committed
Added the ResetCombinator attribute to classes that ignore XML serialization of Device
1 parent 8896447 commit ba36f9e

13 files changed

Lines changed: 14 additions & 1 deletion

File tree

src/Bonsai.ML.Torch/ARange.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Bonsai.ML.Torch
1111
/// Creates a 1-D tensor of values within a given range given the start, end, and step.
1212
/// </summary>
1313
[Combinator]
14+
[ResetCombinator]
1415
[Description("Creates a 1-D tensor of values within a given range given the start, end, and step.")]
1516
[WorkflowElementCategory(ElementCategory.Source)]
1617
public class ARange

src/Bonsai.ML.Torch/CreateTensor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace Bonsai.ML.Torch
1919
/// For example, a 2x2 tensor can be created with the following values: "[[1, 2], [3, 4]]".
2020
/// </summary>
2121
[Combinator]
22+
[ResetCombinator]
2223
[Description("Creates a tensor from the specified values. Uses Python-like syntax to specify the tensor values. For example, a 2x2 tensor can be created with the following values: \"[[1, 2], [3, 4]]\".")]
2324
[WorkflowElementCategory(ElementCategory.Source)]
2425
public class CreateTensor : IScalarTypeProvider

src/Bonsai.ML.Torch/Empty.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Bonsai.ML.Torch
1010
/// Creates an empty tensor with the given data type and size.
1111
/// </summary>
1212
[Combinator]
13+
[ResetCombinator]
1314
[Description("Creates an empty tensor with the given data type and size.")]
1415
[WorkflowElementCategory(ElementCategory.Source)]
1516
public class Empty

src/Bonsai.ML.Torch/LinSpace.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Bonsai.ML.Torch
1010
/// Creates a 1-D tensor of equally spaced values within a given range given the start, end, and count.
1111
/// </summary>
1212
[Combinator]
13+
[ResetCombinator]
1314
[Description("Creates a 1-D tensor of equally spaced values within a given range given the start, end, and count.")]
1415
[WorkflowElementCategory(ElementCategory.Source)]
1516
public class LinSpace

src/Bonsai.ML.Torch/NeuralNets/Backward.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace Bonsai.ML.Torch.NeuralNets
1212
/// Trains a model using backpropagation.
1313
/// </summary>
1414
[Combinator]
15+
[ResetCombinator]
1516
[Description("Trains a model using backpropagation.")]
1617
[WorkflowElementCategory(ElementCategory.Transform)]
1718
public class Backward

src/Bonsai.ML.Torch/NeuralNets/Forward.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Bonsai.ML.Torch.NeuralNets
1010
/// Runs forward inference on the input tensor using the specified model.
1111
/// </summary>
1212
[Combinator]
13+
[ResetCombinator]
1314
[Description("Runs forward inference on the input tensor using the specified model.")]
1415
[WorkflowElementCategory(ElementCategory.Transform)]
1516
public class Forward

src/Bonsai.ML.Torch/NeuralNets/LoadModuleFromArchitecture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Bonsai.ML.Torch.NeuralNets
1010
/// Loads a neural network module from a specified architecture.
1111
/// </summary>
1212
[Combinator]
13+
[ResetCombinator]
1314
[Description("Loads a neural network module from a specified architecture.")]
1415
[WorkflowElementCategory(ElementCategory.Source)]
1516
public class LoadModuleFromArchitecture

src/Bonsai.ML.Torch/NeuralNets/LoadScriptModule.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Bonsai.ML.Torch.NeuralNets
1010
/// Loads a TorchScript module from the specified file path.
1111
/// </summary>
1212
[Combinator]
13+
[ResetCombinator]
1314
[Description("Loads a TorchScript module from the specified file path.")]
1415
[WorkflowElementCategory(ElementCategory.Source)]
1516
public class LoadScriptModule
@@ -19,7 +20,7 @@ public class LoadScriptModule
1920
/// </summary>
2021
[Description("The device on which to load the model.")]
2122
[XmlIgnore]
22-
public Device Device { get; set; } = CPU;
23+
public Device Device { get; set; }
2324

2425
/// <summary>
2526
/// The path to the TorchScript model file.

src/Bonsai.ML.Torch/NeuralNets/SaveModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace Bonsai.ML.Torch.NeuralNets
99
/// Saves the model to a file.
1010
/// </summary>
1111
[Combinator]
12+
[ResetCombinator]
1213
[Description("Saves the model to a file.")]
1314
[WorkflowElementCategory(ElementCategory.Sink)]
1415
public class SaveModel

src/Bonsai.ML.Torch/Ones.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ namespace Bonsai.ML.Torch
1010
/// Creates a tensor filled with ones.
1111
/// </summary>
1212
[Combinator]
13+
[ResetCombinator]
1314
[Description("Creates a tensor filled with ones.")]
1415
[WorkflowElementCategory(ElementCategory.Source)]
1516
public class Ones

0 commit comments

Comments
 (0)